<?php

/*
Stock Shops (admin_stock_shops.php)
*/

$page_title = "Stock Shops";
$rank_check = 7;
include "../header.inc.php";

print "$openHTML";

$findItems = mysql_query("SELECT * FROM shop_items2 WHERE game = '$game'");
while ($getItems = mysql_fetch_array($findItems))
{
	$id = $getItems[id];

	if ($act == "low")
	{
		$getItems[max_stock] = round($getItems[max_stock] / 2);
		$rand[$id] = rand(0,$getItems[max_stock]);
	}
	if ($act == "medium")
	{
		$rand[$id] = rand(0,$getItems[max_stock]);
	}
	if ($act == "max")
	{
		$rand[$id] = $rand[$id] = $getItems[max_stock];
	}
	
	mysql_query("UPDATE shop_items2 SET cur_stock=$rand[$id] WHERE id = '$id' AND game = '$game'");
}

record("Stock Shops", "A $act stock has just been done.", $timestamp, $game, $userid);

print "Shops Restocked.";

print "$closeHTML";
?>
